<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="node_modules/jquery/dist/jquery.js"></script>
    <script src="node_modules/lodash/lodash.js"></script>
    <script src="dist/1.3.0/midway/amoeba.umd.js"></script>
</head>
<body>
    <script>
        var dd={
            
        }
        function FunctionalModule(context) {
            this.context = context;
            this.context.addSubscriber("setResult", this.setResult);
        }

        FunctionalModule.prototype.setResult = function(data) {
            console.log("Functional Module getResult", data);
        };

        FunctionalModule.prototype.setQuestionStatus = function () {
            this.context.setQuestionStatus("lock", {data: "demo"});
        };

        function GameModule(context) {
            this.context = context;
            this.context.addSubscriber("setQuestionStatus", this.setQuestionStatus);
        }

        GameModule.prototype.setResult = function() {
            this.context.setResult({data: "demo"});
        };

        GameModule.prototype.setQuestionStatus = function(data) {
            console.log("Game Module getQuestionStatus",data);
        };
        
        var  gameInstance = window.Amoeba.gameInstanceMgr.getInstance();
        var functional = new FunctionalModule(gameInstance.Context);
        var game = new GameModule(gameInstance.Context);

        functional.setQuestionStatus();
        game.setResult();

    </script>
</body>
</html>